package org.minbox.framework.microservice.common.enums;

import lombok.Getter;

/**
 * 通用异常类型枚举
 *
 * @author XiaoQingqing
 * @since 2024/08/15
 */
@Getter
public enum CommonExceptionTypeEnum {
    LOGIN_EXCEPTION(401,"登录异常"),
    FORBIDDEN_EXCEPTION(403, "授权异常"),
    SYSTEM_EXCEPTION(500, "系统异常"),
    UNKNOWN_EXCEPTION(501, "未知异常"),
    PARAM_EXCEPTION(502, "参数异常"),
    OPERATION_EXCEPTION(503, "操作异常");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;

    /**
     * 构造器
     *
     * @param code 编码
     * @param name 名称
     */
    CommonExceptionTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
}
